package com.marktotop.file.service;

import com.marktotop.file.entity.TbFile;
import com.marktotop.file.exception.SystemException;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author WXLD
 * @data 2021/4/16 - 9:07
 */
public interface FastdfsService {


    /**
     * 上传图片
     * @param filename
     * @param image
     * @return
     * @throws SystemException
     */
    String uploadImage(String filename,MultipartFile image)throws SystemException;


    /**
     * 上传文件
     * @param filename
     * @param file
     * @return
     * @throws SystemException
     */
    String uploadFile(String filename,MultipartFile file) throws SystemException;


    /**
     * 下载文件
     * @param fileUrl
     * @return
     * @throws IOException
     */
    byte[] downloadFile(String fileUrl) throws IOException;


    /**
     * 删除文件
     * @param deleteFile
     * @return
     * @throws SystemException
     */
    int deleteFile(TbFile deleteFile) throws SystemException;
}
